<div class="col-md-8">
<div class="main-content" id="main-content">
	<div class="sub-content">
		<div class="top-header page-header clearfix">
			<h1>Reports List</h1>
		</div>
		<div class="col-md-12">
			<div class="row"><a href="javascript:void();" onclick="pendingData(this.text)" class="btn btn-danger" role="button">Pending Products</a>
			</div>
			<div class="row spacer20"><a href="javascript:void();" onclick="pendingData(this.text)" class="btn btn-danger" role="button">Active Products</a>
			</div>
			<div class="row spacer20"><a href="javascript:void();" onclick="pendingData(this.text)" class="btn btn-danger" role="button">Bid Products</a>
			</div>
		</div>
	 
	 <div class="row">
	  <div id="visualization" style="width: 100%; height: 400px;"></div></div>
	  <div class="row">
	  <div id="visualization1" style="width: 100%; height: 400px;"></div></div>
</div> </div></div>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
</script>
<script>
function pendingData(type){
	reloadChart(type);
}
function reloadChart(textValue){
$('#visualization').html('Please wait loading....');
	$.ajax({
			type:	'GET',
			dataType:'json',
			url:BASE_PATH+'/products/reports-pending?id='+textValue,
			success: function(datatotal){
			if(datatotal=='1'){
				$('#visualization').html('No data....');
			}else{
					var data = google.visualization.arrayToDataTable(datatotal);
					  if(textValue=="Pending Products"){
						new google.visualization.PieChart(document.getElementById('visualization')).
						draw(data, {title:"Admins Pending Products"});
						
					  }else if(textValue=="Active Products"){
						new google.visualization.PieChart(document.getElementById('visualization')).
						draw(data, {title:"Admins Active Products"});
					  }else if(textValue=="Bid Products"){
						new google.visualization.PieChart(document.getElementById('visualization')).
						draw(data, {title:"Bid Pending Products"});
					  }
					  if(datatotal=='json'){
						$('#visualization1').html('no data');
						$('#visualization').html('');
					  }
			 }
			}
	});
}
</script>